using System;

namespace NUnit.Behave
{
    public class ThenContext : Context
    {
        public ThenContext()
        {
            singleMessageType = MessageType.Then;
            singleMessageTypePending = MessageType.Then_Pending;
            conjunctionMessageType = MessageType.Then_And;
            conjunctionMessageTypePending = MessageType.Then_And_Pending;
        }

        public ThenContext Add_AddVerb<T>(string thenMessage, T actionValue)
        {
            return EvaluateMessageForCatalogEntry(this, thenMessage, actionValue, MessageType.Then_Pending);
        }

        public ThenContext And<T>(string thenMessage, T actionValue)
        {
            return EvaluateMessageForCatalogEntry(this, thenMessage, actionValue, MessageType.Then_And_Pending);
        }

        public ThenContext Add_AddVerb<T>(string thenMessage, T actionValue, Action<T> delegateAction)
        {
            return EnvokeActionAndStoreForLaterUse(this, actionValue, delegateAction, thenMessage, MessageType.Then);
        }

        public ThenContext And<T>(string thenMessage, T actionValue, Action<T> delegateAction)
        {

            return
                EnvokeActionAndStoreForLaterUse(this, actionValue, delegateAction, thenMessage, MessageType.Then_And);
        }

        protected override void PassToNextProvider(IMessageProvider provider)
        {
            //Intentionally left blank
        }
    }
}